﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Content;

namespace kb_24_the_game
{
    class MusicPlayer
    {
        #region Variabelen Declaratie
        int level;
        ContentManager content;


        #endregion

        public MusicPlayer(ContentManager content, int level)
        {
            this.level = level;
            this.content = content;
            
        }

        public void PlayMusic()
        {
            if (level == 0)
            {
                Song song = content.Load<Song>("Music/mainmenu");
                MediaPlayer.Play(song);
                MediaPlayer.IsRepeating = true;
            }
            else if (level == 1)
            {
                Song song = content.Load<Song>("Music/level1");
                MediaPlayer.Play(song);
                MediaPlayer.IsRepeating = true;
            }
            else if (level == 2)
            {
                Song song = content.Load<Song>("Music/level2");
                MediaPlayer.Play(song);
                MediaPlayer.IsRepeating = true;
            }
            else if (level == 3)
            {
                Song song = content.Load<Song>("Music/level3");
                MediaPlayer.Play(song);
                MediaPlayer.IsRepeating = true;
            }
            else if (level == 4)
            {
                Song song = content.Load<Song>("Music/level4");
                MediaPlayer.Play(song);
                MediaPlayer.IsRepeating = true;
            }

        }
        public void StopMusic()
        {
            MediaPlayer.Stop();
        }
       
    }
}
